package com.cn.server.Impl;

import com.cn.dao.User;
import com.cn.mapper.UserMapper;
import com.cn.server.UserServer;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

public class UserServerImpl implements UserServer {
    @Autowired
    private UserMapper userMapper;
    @Autowired
    private User user;
    @Override
    public User getUserByEmail(String email) {
        List<User>userList = userMapper.selectUserAll();
//        try{
//            user = userMapper.selectUserByEmail(email);
//            System.out.println(user.getEmail());
//            System.out.println(user.getPassword());
//            return user;
//        }catch (Exception e){
//            user = new User();
//            user.setEmail("-1");
//            user.setPassword("-1");
//            return user;
//        }

        //}
        System.out.println(userList.get(0).getEmail());
        System.out.println(userList.get(0).getPassword());
        return user;
    }
}
